#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>

int main(int argc,char* argv[])
{
  if(argc < 3){
    printf("utilisation : %s nbre_block taille_matrice nom_mat\n",argv[0]);
    return 0;
  }
  srand(time(NULL));
  int k,i;
  int nb_block = atoi(argv[1]);
  int taille_mat = atoi(argv[2]);
  FILE * fd = fopen(argv[3],"w+");
  fprintf(fd,"%d\n",nb_block);
  for (i=0 ; i<taille_mat ; ++i)
    { 
      for(k=0 ; k<taille_mat ; ++k)
	{
	  fprintf(fd,"%d ",rand()%10);
	}
      fprintf(fd,"\n");
    }
  return EXIT_SUCCESS;
}
